import axios from 'axios';
import type { CommonListRes } from './commonType'

export interface ProductQuery {
  page?: number,
  size?: number,
  status?: string,
  o_id?: number,
  fuzzy_search?: string,
  plan_name?: string,
  business_uid?: number,
  entry_status?: string
}

export interface ProductUpdate{
  id: number,
  entry_status?: number,
}


export interface ProductClue {
  id: number,
  uid: number,
  remark: string
}

export interface ProductItem {
  id: number,
  name: string,
  entry_status: number,
  plan_name: string,
  clue_count: number
}

/**
 * 获取产品列表
 * @param data 
 * @returns 
 */
export function getProductList(data: ProductQuery) {
  return axios.post<CommonListRes>('/organization/product/listpage', data);
}

/**
 * 更新产品
 * @param data 
 * @returns 
 */
export function updateProduct(data: ProductUpdate) {
  return axios.post<CommonListRes>('/organization/product/updatepart', data);
}

/**
 * 产品移交
 * @param data 
 * @returns 
 */
export function ProductClueUpdate(data: ProductClue) {
  return axios.post<CommonListRes>('/organization/clue/update', data);
}

